<{capture name="header"}>
<link href="../apps/ome/statics/ome.css" rel="stylesheet" type="text/css">
<{/capture}>
  <div>
  <h3>客服绩效匹配模式<{help}><{t}>如果订单备注中存在 [-user-]，那么该订单将属于系统登录用户名为 user 的客服绩效
<{/t}><{/help}></h3>
     <form method='post' action='index.php?app=omekpi&ctl=admin_servicer&act=setmark' id ='setMark'>
     <table>
      <tr><th><em class="c-red">*</em></th><td>左匹配：<input type="text" name="left_mark" vtype="required" value="<{$left}>"></td></tr>
      <tr><th><em class="c-red">*</em></th><td>右匹配：<input type="text" name="right_mark" vtype="required" value="<{$right}>"></td></tr>
      
      </table>
      <{button class="btn-primary" id="btn_setMark" label="提交" type='submit'}>
     </form>
  </div>
  <div class="tableform">
    <h3>客服绩效</h3>
  <div class="division">
      <div class="gridlist" style="padding:10px;">
      <form method='post' id ='serachForm' action="index.php?app=omekpi&ctl=admin_servicer&act=search">
        时间 <{input name="begin_date" id="begin_date" value="{$begin_date}" type="date" }> 至 <{input type="date" value="{$end_date}"  id="end_date"  name="end_date"}>
        <select name="select" id="select">
          <option value='NO'>员工编号</option>
          <option value='NA'>员工姓名</option>
        </select>
         <{input name="have" type="text" value=''}> <{button label="搜索" type='submit'}> &nbsp;&nbsp; &nbsp;
       </form>
       <form method='post' id='exportForm' action='index.php?app=omekpi&ctl=admin_servicer&act=export' class="tableform" target='download' enctype="multipart/form-data">
        <{button class="btn-primary" label="导出" type='submit'}>
        <textarea name="csv_data" style="display:none;" ><{$csv_data}></textarea>
       </form>
   </div>
    
<form method="post" id="fm2" action="index.php?app=omekpi&ctl=admin_servicer&act=doadd">
      <table class="gridlist" id="purchase_table"  style="margin:4px 0; width:780px;">
        <thead>
          <tr>
            <th>员工编号</th>
            <th>员工姓名</th>
            <th>已接订单数量</th>
            <th>已付款订单数量</th>
            <th>销售总额</th>
            <th>日期</th>
          </tr>
        </thead>
        <tbody id='dNode'>
         <{foreach from=$slog_List item=item key=key}>
          <tr id="<{$item.employee_id}>">
            <td style="display:none;"><{$item.employee_id}></td>
            <td><{$item.employee_op_no}></td>
            <td><{$item.employee_name}></td>
            <td><strong><a href="javascript:void(0);" key="received_orders"><{$item.received_orders}></a></strong></td>
            <td><strong><a href="javascript:void(0);" key="payed_orders"><{$item.payed_orders}></a></strong></td>
            <td><strong><a href="javascript:void(0);" key="my_sales"><{$item.my_sales}></a></strong></td>
            <td class="date"><strong><{$item.createdate|date:'Y-m-d'}></strong></td>
          </tr>
         <{/foreach}>
        </tbody>
      </table>
      </form>
      <div class="gridlist-footer" style="width:760px; text-align:right;">已接订单共计：<{$count.count_orders}> &nbsp;&nbsp;&nbsp;已付款订单：<{$count.count_paded_orders}> &nbsp;&nbsp;&nbsp;销售总额共计：<{$count.count_sales}></div>
 
  </div>

<script>
(function(){
 $$("#dNode a").each(function(item,i){
    var parent=item.getParent("tr");
    var id=parent.get("id");
    var name=item.get("key");
    var date=parent.getElement("td.date").get('text');
    
    if(name=='received_orders'){
        item.addEvent('click',function(e){
        
            var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent('index.php?app=omekpi&ctl=admin_servicer&act=getOrders&id='+id+'&name='+name+'&date='+date);
            new finderDialog(url,{width:1000,height:660});
        });
    }
    if(name=='payed_orders' || name== 'my_sales'){
        item.addEvent('click',function(e){
        
            var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent('index.php?app=omekpi&ctl=admin_servicer&act=getPayedOrders&id='+id+'&name='+name+'&date='+date);
            new finderDialog(url,{width:1000,height:660});
        });
    }
 });
    
})();
  
</script>
